var express = require('express');
var router = express.Router();
var query = require('../util/dbHelper.js');//引入连接池，

var data = require("../data/home.js");
router.post('/home', function(req, res, next) {
    req.myPromise = query("SELECT * FROM `dt_mi_index`;")//调用sql函数，查询dt_mi_index的所有数据
        .then(results => {
            return {status:200,message:"",data:results};
        });
    next();
});
router.post('/all', function(req, res, next) {
    res.send({status:200,message:"",data:data});
});

module.exports = router;
